package com.atguigu.shirolearn.service.impl;


import com.atguigu.shirolearn.bean.User;
import com.atguigu.shirolearn.mapper.UserMapper;
import com.atguigu.shirolearn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    @Override
    public User getUserByName(String name) {


        User user = new User();
        user.setName(name);
        return userMapper.selectOne(user);

    }

    @Override
    public User getUserById(Integer id) {
        User user = new User();
        user.setId(id);
        return userMapper.selectOne(user);
    }
}
